package com.liu.hooks;

import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;

import com.liu.util.TrackerLoger;

import de.robv.android.xposed.XC_MethodHook;

public class LogHook extends AbstractHook {

	public static final String TAG = "#LogHook#";
	
	public static final String TYPE = "com.liu.hooks.LogHook";
	
	public XC_MethodHook logHook = new XC_MethodHook() {
		@Override
		protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
			if(!((String)param.args[1]).contains("#"))
				TrackerLoger.log(TAG, "[Msg] " + param.args[1], TYPE , false);
		}
	};
	
	@Override
	public void doHook() {
		findAndHookMethod("android.util.Log", classloader, "i", String.class, String.class, logHook);
	}

	@Override
	public void setClassLoader(ClassLoader classloader) {
		this.classloader = classloader;
		
	}



}
